<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page isELIgnored="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript">
			$(function() {
				parent.$.messager.progress('close');
				
				$('#form').form({
					url : '<%=request.getContextPath() %>/user/saveUser',
					success : function(data) {
						parent.$.messager.progress('close');
						var data = $.parseJSON(data);
						if (data.result) {
							parent.$.modalDialog.handler.userGrid.datagrid('reload');
							parent.$.modalDialog.handler.dialog('close');
						} else {
							parent.$.messager.alert('提示', data['message'], 'info');
						}
					}
				});
			});
		</script>
	</head>
	<div class="easyui-layout" data-options="fit:true,border:false">
		<div data-options="region:'center',border:false" title="" style="overflow: hidden;">
			<form id="form" method="post" >
				<input type="hidden" name="userid" value="${user.userid}">
			
				<table class="formtab">
					<tr>
						<th>用户名</th>
						<td><input name="username" type="text" value="${user.username}" readonly="readonly"></td>
					</tr>
					<tr>
						<th>姓名</th>
						<td>
							<input name="nickname" type="text" data-options="required:true" class="easyui-validatebox" maxlength="30" value="${user.nickname}">
						</td>
					</tr>
					<tr>
						<th>是否启用</th>
						<td>
							<c:if test="${user.enable}">
								<input type="radio" name="enable" value="true" checked="checked"> 是
								<input type="radio" name="enable" value="false"> 否
							</c:if>
							<c:if test="${!user.enable}">
								<input type="radio" name="enable" value="true"> 是
								<input type="radio" name="enable" value="false" checked="checked"> 否
							</c:if>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</html>
